package st.magnuzon.book.client.managed.ui;

import com.google.gwt.requestfactory.ui.client.ProxyRenderer;
import st.magnuzon.book.client.managed.request.AuthorProxy;

public class AuthorProxyRenderer extends ProxyRenderer<AuthorProxy> {

    private static st.magnuzon.book.client.managed.ui.AuthorProxyRenderer INSTANCE;

    protected AuthorProxyRenderer() {
        super(new String[] { "firstName" });
    }

    public static st.magnuzon.book.client.managed.ui.AuthorProxyRenderer instance() {
        if (INSTANCE == null) {
            INSTANCE = new AuthorProxyRenderer();
        }
        return INSTANCE;
    }

    public String render(AuthorProxy object) {
        if (object == null) {
            return "";
        }
        return object.getFirstName() + " (" + object.getId() + ")";
    }
}
